const mqtt = require('mqtt')

let username = "admin"
let password = "nttieren0513"

// iot生产环境
let connectUrl = 'wss://iot.ironmanapi.com:8084/mqtt'
connectUrl = 'ws://180.107.109.102:8083/mqtt'


// 连接选项
const options = {
    clean: true, // true: 清除会话, false: 保留会话
    connectTimeout: 15000, // 超时时间
    username,
    password,
    keepalive: 5,
}

const client = mqtt.connect(connectUrl, options)

module.exports = {
    client
}
